﻿using System;
using ExcelAutomator.Configuration;
using NUnit.Framework;

namespace ExcelAutomator.Tests
{
	[TestFixture]
	public class SchemaValidationTestFixture
	{

		#region ThrowIfNoSettingsDefined
		[Test, ExpectedException(typeof(InvalidOperationException))] //In fact, a XMLSchemaValidationException is thrown, but the XMLSerializer swallows it!
		public void ThrowIfNoSettingsDefined()
		{
			var xml = TestHelper.GetStringResource("ExcelAutomator.Tests.SchemaValidation.NoSettingsDefined.xml");
			ExcelAutomatorConfiguration.FromXml(xml);
		}
		#endregion

		#region ThrowIfNowExecutionSetIsDefined
		[Test, ExpectedException(typeof(InvalidOperationException))]
		public void ThrowIfNowExecutionSetIsDefined()
		{
			var xml = TestHelper.GetStringResource("ExcelAutomator.Tests.SchemaValidation.NoExecutionSetDefined.xml");
			ExcelAutomatorConfiguration.FromXml(xml);
		}
		#endregion
		


	}
}
